{% extends 'CaisseBundle::layout.html.twig' %} 
{% block body %} 
<div id="body_section">
  <div id="body_section_inner">
<div class="contentPageWrapper">
	 
    <!-- register form -->
    <div class="pageSectionMain ui-corner-all">
        <div class="pageSectionMainInternal">
            <div id="pageHeader">
                <h2>{% if id == '' %}Nouvelle commande{% else %}Modifier la commande{% endif %}</h2>
            </div>
            <div>
                <p class="introText">
                    SVP completez les données suivantes pour cet commande.   </p>
                    <script type='text/javascript' src='/js/jquery-1.7.2.min.js?ver=3.4.1'></script>
                    
                           <script>
                                            $('#caisse_caissebundle_article_image').uploadify({
                                                'width': 72,
                                                'height': 72,
                                                'uploader': '/uploadify/uploadify.swf',
                                                'script': '/uploadify/uploadify.php',
                                                'cancelImg': '/uploadify/cancel.png',
                                                'folder': '/uploads/articles',
                                                'fileExt': '*.png;*.jpg;*.jpeg;',
                                                'fileDesc': 'Images Files',
                                                'auto': true,
                                                'buttonImg': '/uploadify/uploas.png',
                                                'onSelect': function(event, ID, fileObj) {
                                                    
                                                    $('#caisse_caissebundle_article_image').val(fileObj.name)
                                                },
                                                'onCheck': function(event, ID, fileObj) {
                                                    alert('ok')
                                                    uploadifyCancel(ID)
                                                },
                                                'onComplete': function(event, ID, fileObj) {
                                                    $('#apperci_image').attr('src', '/uploads/article/' + fileObj.name)
                                                    
                                                }

                                            });   
                        </script>
                    <form enctype="multipart/form-data" class="international" method="post" action="{{path('caisse_ajout_article')}}" id="form-join" name="addproduct" {{form_enctype(form)}}>
                <input type="hidden" name="MAX_FILE_SIZE" value="204800">
                    <ul>
                        <li class="field-container"><label for="pr_nom">
                                <span class="field-name">Date commande</span>
                                <div class="form_input"><input type="hidden" value="{{id}}" name="id" />
                                                  {{form_widget(form._token)}} {{ form_widget(form.date,{'attr':{'class':'large'}})}}  

                                        </div>
                            
                        </li>
                        
			<li class="field-container"><label for="pr_name">
			<span class="field-name">Description</span>
                               </label>
                             <div class="form_input">
						{{ form_widget(form.descriptionCd,{'attr':{'class':'large'}})}}  
                                            </div>
                                        </li>
                                        <br/>
                                  <li class="field-container">
                            <label for="unit">
                                <span class="field-name">Prix</span>
                            </label>
                            
                           <div class="form_input">
                 {{ form_widget(form.prix,{'attr':{'class':'large'}})}}  
                                                </div>
             
                        </li>
                            <li class="field-container">
                            <label for="role">
                                <span class="field-name">Catégorie</span>
                                <div class="form_input">

                                                 {{ form_widget(form.categorie,{'attr':{'class':'chzn-select'}})}}

                                                        </div>
                            </label>
                             </li>   
                              <li class="field-container">
                            <label for="unit">
                                <span class="field-name">Etat</span>
                            </label>
                            
                           <div class="form_input">
                              
                   {{ form_widget(form.etat,{'attr':{'class':'chzn-select'}})}}
                                                </div>
             
                        </li>
                        
                 
                                    <li class="field-container">
                            <label for="unit">
                                <span class="field-name">Image</span>
                            </label>
                            
                           <div class="form_input">
                 {{ form_widget(form.file,{'attr':{'class':'large'}})}}  
                 
                                                    </div>
            
                        </li>
                        
   <br/>
 



                        <li class="field-container">
                            <span class="field-name"></span>
                                 <input type="submit" name="submit" value="{% if id == '' %}Ajouter l'article{% else %}Modifier l'article{% endif %}" class="submitInput ui-button ui-widget ui-state-default ui-corner-all" role="button">
                            <input type="reset" value="Initialiser" class="submitInput ui-button ui-widget ui-state-default ui-corner-all" role="button"/>
                        </li> 
                    </ul>

                    <input type="hidden" value="1" name="submitme">
                </form>


                <div class="clear"></div>
            </div>
        </div>
    </div>
        <div class="clear"><!-- --></div>
</div>

<div class="clr"></div>

  </div>
  <div class="clear"></div>

</div>

{% endblock body %} 